<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<x:parse xml="${param.xmlstr}" var="xmlData"/>
<input type="hidden" name="zh_parsen/fzr_name"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email"
       value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>

<input type="hidden" id="if_have_org" name="proposal/if_have_org">
<div class="t_bar"><span class="color_red">*</span>${param.title}</div>
<table class="t_css" width="100%" id="basic_info_jzfp" border="0" cellpadding="0"
       cellspacing="1">
    <col style="width: 20%"/>
    <col style="width: 20%"/>
    <col style="width: 20%"/>
    <col style="width: 20%"/>
    <col style="width: 20%"/>
    <tr class="li_1">
        <td align="right">研发机构名称（全称）：</td>
        <td colspan="4">
            <span name="organizations/organization/org_name">
                <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name"/>
            </span>
        </td>
    </tr>
    <tr class="li_1">
        <td align="right">国内外重点科研院所、高校名称（全称）：</td>
        <td colspan="4">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 88%"
                   class="input_css required" maxlength="100"
                   value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="国内外重点科研院所、高校名称">
        </td>
    </tr>
    <tr>
        </td>
        <td align="right">申报日期：</td>
        <td>
            <c:set var="submit_date">
                <x:out select="$xmlData/data/proposal/submit_date"/>
            </c:set>
            <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date"
                      label="申报日期"></cpt:date>
        </td>
        <td align="right">归口管理单位：</td>
        <td colspan="2">
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value"/>','name':'<x:out
                select="$xmlData/data/proposal/recomend_org_name"/>'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true"
                      value="${recomend_org}" label="归口管理单位"
                      id="recomend_org" onlyChooseLeaf="false" showPattern="all" shieldPattern="0" topCheckbox="true"
                      onClick="initTreeValueExt"/>
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required"
                   value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
            <input type="hidden" name="proposal/recomend_org_name"
                   value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
    </tr>
    <tr>
        <td align="right" rowspan="3">机构负责人：</td>
        <td align="right">姓名：</td>
        <td>
            <span name="proposal/fzr_psnname">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>
            </span>
        </td>
        <td align="right">手机号：</td>
        <td>
            <span name="proposal/fzr_mobile">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>
            </span>
        </td>
    </tr>
    <tr>
        <td align="right">职称：</td>
        <td>
            <span name="proposal/fzr_prof_title_name">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name"/>
            </span>
        </td>
        <td align="right">专业：</td>
        <td>
            <span name="proposal/major">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/major"/>
            </span>
        </td>
    </tr>
    <tr>
        <td align="right">电子邮箱：</td>
        <td>
            <span name="proposal/fzr_email">
                <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>
            </span>
        </td>
        <td align="right">联系电话：</td>
        <td>
            <span name="proposal/fzr_tel">
                 <x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>
            </span>
        </td>
    </tr>
    <tr>
        <td align="right" rowspan="2">联系人：</td>
        <td align="right">姓名：</td>
        <td>
            <input type="text" label="联系人-->姓名" name="proposal/contact_psn_cname" class="input_css required"
                   maxlength="30" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
        </td>
        <td align="right">手机号：</td>
        <td>
            <input type="text" label="联系人-->手机号" name="proposal/contact_psn_mobile" class="input_css required mobile"
                   onfocus="InitInput.setNumber(this,11,0,0)" maxlength="11"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
        </td>
    </tr>
    <tr>
        <td align="right">电子邮箱：</td>
        <td>
            <input name="proposal/contact_psn_email" label="联系人-->电子邮箱" type="text" maxlength="50"
                   class="input_css required email"
                   value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/>
        </td>
        <td align="right">通讯地址：</td>
        <td>
            <input name="proposal/contact_psn_address" label="联系人-->通讯地址" type="text" class="input_css required"
                   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_address" />"/>
        </td>
    </tr>
</table>

<script type="text/javascript">

    function initTreeValueExt(treeId, treeNode) {
        if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
            scmWarn($("#" + treeId).attr("label") + messageTip.researchAreaInvalidDisciplineCode);
            if (treeNode.level == 0) {
                $("#" + treeId).val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val("");
                $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            }

            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }

    function getLen() {
        var len = $("#tblorg_hzs tr:gt(1)").length;
        if (len > 0) {
            $("#if_have_org").val("1");
        } else {
            $("#if_have_org").val("0");
        }
    }
</script>       
